﻿using ConfigCreate.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConfigCreate
{
    /// <summary>
    /// 数字框控件
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public class CreateNumericAttribute : CreateBaseAttribute
    {
        /// <summary>
        /// 数字框控件
        /// </summary>
        /// <param name="header_name">大类别名</param>
        /// <param name="group_name">组名</param>
        /// <param name="title">控件标题</param>
        public CreateNumericAttribute(string header_name, string group_name, string title) : base(header_name, group_name, title)
        { }

        /// <summary>
        /// 最大值
        /// </summary>
        public double MaxValue { get; set; } = double.MaxValue;
        /// <summary>
        /// 最小值
        /// </summary>
        public double MinValue { get; set; } = 0;
        /// <summary>
        /// 小数点的位数
        /// </summary>
        public int Places { get; set; } = 0;
        /// <summary>
        /// 设置Increment改变单击一下按钮时增加或减少的数量
        /// </summary>
        public double Increment { get; set; } = 1;
        /// <summary>
        /// 占位符
        /// </summary>
        public string Placeholder { get; set; } = string.Empty;
        /// <summary>
        /// 是否显示清空按钮
        /// </summary>
        public bool ShowClearButton { get; set; } = true;
        /// <summary>
        /// 是否为只读模式
        /// </summary>
        public bool IsReadonly { get; set; }
        /// <summary>
        /// 转换数值格式
        /// </summary>
        public string? ValueFormat { get; set; }
        /// <summary>
        /// 转换规则检测类的属性名（属性类型为ValidationRule类型）
        /// </summary>
        public string? ValidationRule { get; set; }
    }
}
